package com.lmx.repoDomain.tmodel;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiLookupIncludeAutomatically;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.lmx.repoDomain.tmodel.business.User;

/**
 * 护理计划表/居家订单表
 */
@JsonApiResource(type = "nursingplandetail")
@Table(name = "tnb_nursingplan_detail")
@Entity
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class NursingPlanDetail extends BaseEntity {

	private User lastUpdateUser;// 更新操作者userid

	private Integer createDateTime;// 创建时间

	private User createUser;

	private Integer lastUpdateDateTime;// 更新时间

	private String remark;// 备注

	private Integer yearTab;// 年

	private Integer weekIndex;// 周序号

	private Integer weekTab;// 星期几
	
	private Integer monthIndex;// 几月

	private Integer monthTab;// 几号

	private String startTimeTab;// 小时标记

	private Customer customer;

	private NursingProjectServiceItem item;

	private CustomerNursingPlan plan;

	private Integer monthPlanNum;// 月计划 当天次数
	
	private Integer weekPlanNum;// 周计划 当天次数

	private Integer dayPlanNum;// 日计划当天次数

	private Integer weekCounts;// 周计划当周次数

	// 居家下单属性
	private Dicttype serviceStatus;// 订单 状态 待接单 已接单 在路上 完成

	private Integer serviceTime;// 订单 服务时间

	private Double servicePrice;// 服务价格

	private Employee serviceOperater;// 服务接单人

	private String serviceTel;// 预约人电话

	private String serviceAddress;// 预约人地址
	
	private Dicttype paymentType;// 支付类型
	
	private String serviceRemark;// 订单备注

	@Column(name = "service_remark")
	public String getServiceRemark() {
		return serviceRemark;
	}

	public void setServiceRemark(String serviceRemark) {
		this.serviceRemark = serviceRemark;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@Fetch(FetchMode.JOIN)
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "pay_type_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getPaymentType() {
		return paymentType;
	}

	public void setPaymentType(Dicttype paymentType) {
		this.paymentType = paymentType;
	}

	@Column(name = "service_tel")
	public String getServiceTel() {
		return serviceTel;
	}

	public void setServiceTel(String serviceTel) {
		this.serviceTel = serviceTel;
	}

	@Column(name = "service_address")
	public String getServiceAddress() {
		return serviceAddress;
	}

	public void setServiceAddress(String serviceAddress) {
		this.serviceAddress = serviceAddress;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@Fetch(FetchMode.JOIN)
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "service_status_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getServiceStatus() {
		return serviceStatus;
	}

	public void setServiceStatus(Dicttype serviceStatus) {
		this.serviceStatus = serviceStatus;
	}

	@Column(name = "service_time")
	public Integer getServiceTime() {
		return serviceTime;
	}

	public void setServiceTime(Integer serviceTime) {
		this.serviceTime = serviceTime;
	}

	@Column(name = "service_price")
	public Double getServicePrice() {
		return servicePrice;
	}

	public void setServicePrice(Double servicePrice) {
		this.servicePrice = servicePrice;
	}

	@JsonApiToOne
	// @JsonApiIncludeByDefault
	@JsonApiLookupIncludeAutomatically
	@Fetch(FetchMode.JOIN)
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "service_operater_id", foreignKey = @ForeignKey(name = "null"))
	public Employee getServiceOperater() {
		return serviceOperater;
	}

	public void setServiceOperater(Employee serviceOperater) {
		this.serviceOperater = serviceOperater;
	}

	@Transient
	public Integer getWeekCounts() {
		return weekCounts;
	}

	public void setWeekCounts(Integer weekCounts) {
		this.weekCounts = weekCounts;
	}

	@Transient
	public Integer getWeekPlanNum() {
		return weekPlanNum;
	}

	public void setWeekPlanNum(Integer weekPlanNum) {
		this.weekPlanNum = weekPlanNum;
	}

	@Transient
	public Integer getDayPlanNum() {
		return dayPlanNum;
	}

	public void setDayPlanNum(Integer dayPlanNum) {
		this.dayPlanNum = dayPlanNum;
	}

	@Transient
	@JsonApiToOne
	public CustomerNursingPlan getPlan() {
		return plan;
	}

	public void setPlan(CustomerNursingPlan plan) {
		this.plan = plan;
	}

	@Column(name = "year_tab")
	public Integer getYearTab() {
		return yearTab;
	}

	public void setYearTab(Integer yearTab) {
		this.yearTab = yearTab;
	}

	@Column(name = "week_tab")
	public Integer getWeekTab() {
		return weekTab;
	}

	public void setWeekTab(Integer weekTab) {
		this.weekTab = weekTab;
	}

	@Column(name = "week_index")
	public Integer getWeekIndex() {
		return weekIndex;
	}

	public void setWeekIndex(Integer weekIndex) {
		this.weekIndex = weekIndex;
	}

	@Column(name = "starttime_tab")
	public String getStartTimeTab() {
		return startTimeTab;
	}

	public void setStartTimeTab(String startTimeTab) {
		this.startTimeTab = startTimeTab;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@Fetch(FetchMode.JOIN)
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "item_id", foreignKey = @ForeignKey(name = "null"))
	public NursingProjectServiceItem getItem() {
		return item;
	}

	public void setItem(NursingProjectServiceItem item) {
		this.item = item;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@Fetch(FetchMode.JOIN)
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "customer_id", foreignKey = @ForeignKey(name = "null"))
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@Column(name = "createDateTime")
	public Integer getCreateDateTime() {
		return createDateTime;
	}

	public void setCreateDateTime(Integer createDateTime) {
		this.createDateTime = createDateTime;
	}

	@Column(name = "lastUpdateDateTime")
	public Integer getLastUpdateDateTime() {
		return lastUpdateDateTime;
	}

	public void setLastUpdateDateTime(Integer lastUpdateDateTime) {
		this.lastUpdateDateTime = lastUpdateDateTime;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "createuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getCreateUser() {
		return createUser;
	}

	public void setCreateUser(User createUser) {
		this.createUser = createUser;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "lastupdateuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getLastUpdateUser() {
		return lastUpdateUser;
	}

	public void setLastUpdateUser(User lastUpdateUser) {
		this.lastUpdateUser = lastUpdateUser;
	}

	public NursingPlanDetail() {
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "month_index")
	public Integer getMonthIndex() {
		return monthIndex;
	}

	public void setMonthIndex(Integer monthIndex) {
		this.monthIndex = monthIndex;
	}

	@Column(name = "month_tab")
	public Integer getMonthTab() {
		return monthTab;
	}

	public void setMonthTab(Integer monthTab) {
		this.monthTab = monthTab;
	}

	@Transient
	public Integer getMonthPlanNum() {
		return monthPlanNum;
	}

	public void setMonthPlanNum(Integer monthPlanNum) {
		this.monthPlanNum = monthPlanNum;
	}

}
